Repository navigation
FOUR-26628 | Fix Error When Opening a Task with an Imported Assignment Rule - #9110
mcraeteisha wants to merge 13 commits into
Conversation
This change rebinds imported rule_expression assignee records to valid users/groups in the target environment, clearing stale unresolved assignees and marking them for re-selection. It also adds guarded user/group fetches in the picker to avoid noisy 404s when stale assignees remain, and surfaces explicit warnings in the assignment expression inspector when an imported assignee cannot be resolved.
PR SummaryMedium Risk Overview Runtime guards now treat unresolved expression matches as hard failures ( Adds extensive PHPUnit coverage for rebinding edge cases (inactive labels, ambiguous groups, template imports) to lock the behavior in. Reviewed by Cursor Bugbot for commit af28016. Bugbot is set up for automated code reviews on this repo. Configure here. |
Group assignees can be stored as either numeric IDs or strings like group-<id>. This change centralizes normalization so default and special assignments consistently use the plain ID value before string operations, comparisons, and persisted assignment data.
Block unresolved user/group assignment rules after import and during task evaluation so they cannot assign tasks or fall through to the Process Manager.
Move assignment-rule reconciliation into the standard import flow so BPMN-embedded rules are re-bound during saveModelOnly template imports as well as saveAllAssets imports.
Import/export reconciliation now recognizes SelectUserGroup's inactive-user suffix across locales, not just the English "Inactive" label.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 653c95b. Configure here.
The reassign assignee lookup no longer throws on unresolved expression/default assignment rules. These rules are skipped during picker resolution so the UI does not fall through to Default Assignment, while runtime assignment behavior remains unchanged and still resolves via getNextUserByRule. Updated tests cover the skip behavior for matching and default unresolved rules.
|
hi @mcraeteisha this is approved! 👋 👋 |
|
QA server K8S was successfully deployed https://tenant-1.ci-33b6126a5d.engk8s.processmaker.net |
|





Issue
Ticket: FOUR-26628
After importing a Process that contains a task with a Rule Expression assignment, clicking the task in the Modeler displays an error message. In the reported case, opening the task triggered a request for a user ID from the source environment that did not exist in the target environment, resulting in a visible 404 error.
The imported
pm:assignmentRulesdata preserved the source environment's numeric user and group IDs. Neither the current nor legacy import flow reconciled those IDs, so the task inspector attempted to load the stale assignees when the task was opened. If the numeric ID belonged to a different user or group in the target environment, the inspector could also display the wrong assignee.Unresolved rules that still matched at runtime could also bypass a valid Default Assignment and escalate to the Process Manager. Template editing with saveModelOnly skipped reconciliation entirely, so stale IDs remained until a process was created from the template. Inactive-user labels written with a translated $t('Inactive') suffix (for example Spanish inactivo) failed to parse and were incorrectly marked unresolved.
This change affects imported Rule Expression assignments for users and groups. Regular user and group assignments continue to use the existing assignment import behavior.
Solution
processmaker
AssignmentRulesReconciliationto reconcilepm:assignmentRulesduring import without trusting the exported numeric assignee ID.- Inactivesuffix.assignmentNameonly when exactly one matching group exists.ProcessExporterand to legacy process imports throughImportProcess.TaskDoesNotHaveUsersExceptionso execution does not fall through to the Process Manager; the same guard applies inProcess,ProcessExecutionRawRepository, andProcessRequestToken.validateUnresolvedAssignmentRules.js).SelectUserGroupso missing assignees do not produce a global 404 alert, do not leave the picker in a loading state, and are handled locally.AssignExpressionso unresolved assignees are not passed to the user/group picker and instead display “This assignee was not found in this environment. Select a user or group.” under Default Assignment and in the edit card.How To Test
Automated Tests
php vendor/bin/phpunit --filter AssignmentRulesReconciliationTest tests/Feature/ImportExport/AssignmentRulesReconciliationTest.phpphp vendor/bin/phpunit --filter ImportProcessAssignmentRulesTest tests/Feature/Jobs/ImportProcessAssignmentRulesTest.phpphp vendor/bin/phpunit --filter 'testGetAssigneesFromExpressionThrowsWhen' tests/Model/ProcessRequestTokenTest.phpManual Tests
ci:deploy
Code Review Checklist